# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: csslayer <wengxt AT gmail com>

pkgname=fcitx5-chinese-addons
pkgver=5.1.2
pkgrel=1
pkgdesc="Addons related to Chinese, including IME previous bundled inside fcitx4"
arch=('loong64' 'x86_64')
url="https://github.com/fcitx/fcitx5-chinese-addons"
license=('GPL')
conflicts=('fcitx')
depends=('curl' 'fcitx5-qt' 'fmt' 'libime' 'opencc' 'qt5-webkit') #'qt5-webengine')
makedepends=('boost' 'extra-cmake-modules' 'fcitx5-lua' 'ninja')
optdepends=('fcitx5-lua: Lua and imeapi support from pinyin')
source=("https://download.fcitx-im.org/fcitx5/$pkgname/$pkgname-${pkgver}_dict.tar.xz"{,.sig})
sha512sums=('8a94b974b461dc0a20ee7c243d482295359be27a7cc2152755aebdde3330a62f579506666e231d15cd081e58794359f1791b674f8d9f873babf7c68f4dea81a1'
            'SKIP')
validpgpkeys=('2CC8A0609AD2A479C65B6D5C8E8B898CBF2412F9') # Weng Xuetian <wengxt@gmail.com>

build() {
  cd $pkgname-$pkgver

  cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib -DUSE_WEBKIT=On .
  ninja
}

check() {
  cd $pkgname-$pkgver
  ninja test
}

package() {
  cd $pkgname-$pkgver
  DESTDIR="$pkgdir" ninja install
}
